package com.icare.shop.server.rest;

import com.icare.shop.common.base.ResponseResult;
import com.icare.shop.server.feign.TradeFeignService;
import com.icare.shop.server.req.SubmitOrderReq;
import com.icare.shop.server.resp.SubmitOrderResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;




@Slf4j
@RestController
@RequestMapping("v1")
@Api(tags = "交易",value = "交易")
public class TradeRest {

    @Autowired
    private TradeFeignService tradeService;

    @PostMapping("submitOrder")
    @ApiOperation("提交订单")
    public ResponseResult<SubmitOrderResp> submitOrder(@RequestBody SubmitOrderReq req){
        ResponseResult<SubmitOrderResp> responseResult = tradeService.submitOrder(req);
        return responseResult;
    }

}
